package com.novel.common.vo;


import com.novel.pojo.novel.Novel;
import com.novel.pojo.novel.NovelChapter;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 小说章节内容
 * 用于封装数据，返回给页面
 */
@Data
@NoArgsConstructor
public class Chapter {
    private String chapterTitle;//文章标题
    private String chapterContent;//章节内容
    private Date createTime;//更新时间
    private String author;//作者

    public Chapter(Novel novel, NovelChapter novelChapter) {
        this.chapterContent = novelChapter.getChapterContent();
        this.chapterTitle = novelChapter.getChapterName();
        this.author = novel.getAuthorName();
        this.createTime = novelChapter.getCreateTime();
    }
}
